﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="New.ascx.cs" Inherits="Modules_Category_New" %>
<%@ Register Assembly="Portal.Core" Namespace="Portal.Core.Web.UI.Controls" TagPrefix="cc1" %>
<asp:PlaceHolder runat="server" ID="phContent">
    <div class="filter">
        <h3>Thêm chuyên mục</h3>
    </div>

    <table class="Form">
        <tr>
            <td style="width: 20%">Tiêu đề<span class="red bold">(*)</span>
            </td>
            <td>
                <asp:TextBox ID="FullName" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td>Chuyên mục cha
            </td>
            <td>
                <asp:DropDownList ID="Parent_ID" runat="server" DataTextField="DisplayFullName" DataValueField="ID"></asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td>Ảnh
            </td>
            <td>
                <cc1:ImageUpload ID="Icon" runat="server" />
            </td>
        </tr>
        <tr>
            <td>Trạng thái
            </td>
            <td>
                <asp:DropDownList ID="Status" runat="server" DataValueField="Value" DataTextField="Name"></asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td>Thể loại
            </td>
            <td>
                <asp:DropDownList ID="CateType" runat="server" DataValueField="Value" DataTextField="Name"></asp:DropDownList>
            </td>
        </tr>
    </table>

    <br class="clear" />
    <asp:Button ID="Save" CssClass="CommandButton" runat="server" Text="Thêm mới" ValidationGroup="NEW"
        OnClick="Save_Click" OnClientClick="return checkValid();" />
    <asp:Button ID="Cancel" runat="server" CssClass="CommandButton" OnClick="Cancel_Click"
        Text="Bỏ qua" ValidationGroup="xxxx" />
    <script type="text/javascript">
        jQuery(function($) {
            $('#<%=FullName.ClientID %>').focus();
        });
        function checkValid() {
            var title = jQuery('#<%=FullName.ClientID %>');
            if (title.val().length == 0) {
                alert("Hãy nhập tiêu đề!");
                title.focus();
                return false;
            }
            
            return true;
        }
    </script>
</asp:PlaceHolder>
